class_name StateVisualDebug
extends Control

@export var chart:StateChart
@export var state_label:Label
@export var active:bool = true

func _process(delta: float) -> void:
	state_label.visible = active and GameManager.game_mode == GameEnum.GameMode.Dev
	if not state_label.visible:
		return
	if chart and chart.state and chart.state._active_state:
		state_label.text = chart.state._active_state.name
	else:
		state_label.text = "Unknown"
	if (scale.x > 0.001 and get_parent().global_scale.y < -0.001) or (scale.x < -0.001 and get_parent().global_scale.y > 0.001):
		scale = scale * Vector2(-1,1)
